package controller.action;

import java.io.IOException;
import java.io.InputStream;

import model.service.FileService;

import com.opensymphony.xwork2.ActionSupport;

public class FileDownload extends ActionSupport{
	
	private String userId;
	private InputStream inputStream;
	private FileService fileService;
	
	public void setFileService(FileService fileService) {
		this.fileService = fileService;
	}
	public InputStream getInputStream() {
		return inputStream;
	}
	public void setUserId(String userId) {
		this.userId = userId;
	}
	public String fileDownload()
	{
		inputStream  = fileService.fileDownload(userId);
		if(inputStream==null)
		{
			return ERROR;
		}
		return SUCCESS;
	}
	public String getUserId() {
		return userId;
	}
}
